import axios from '@/api/fetch';
import SERVER from '@/api/server';

// 获取状态为已出库的且没有关联退单的订单信息
export const getOrderInfo = params => axios.get(`${SERVER.CYXDMS_RETAIL}/sales/chargeback/getOrderInfo`, { params });

// 查询销售单关联的车辆信息
export const getOrderCarInfo = params => axios.get(`${SERVER.CYXDMS_VEHICLE}/sales/chargeback/getOrderCarInfo`, { params });

// 保存退单信息
export const saveChargeBack = params => axios.post(`${SERVER.CYXDMS_VEHICLE}/sales/chargeback/saveChargeBack`, params);

// 查询退单信息
export const getChargeBackInfo = params => axios.get(`${SERVER.CYXDMS_VEHICLE}/sales/chargeback/getChargeBackInfo`, { params });

// 查询退单车辆详情
export const getDetailsInfoByMainId = params => axios.get(`${SERVER.CYXDMS_VEHICLE}/sales/chargeback/getDetailsInfoByMainId`, { params });

// 获取整车系统参数
export const doSearch = params => axios.post(`${SERVER.DMSCLOUD_BASEDATA}/params/doSearch`, params);

// 删除退单相关信息
export const deleteChargeBackInfo = params => axios.post(`${SERVER.CYXDMS_VEHICLE}/sales/chargeback/deleteChargeBackInfo`, params);

// 查询所有已购车车主信息
export const getOwnerAndCarInfo = params => axios.get(`${SERVER.DMSCLOUD_REPAIR}/info/owner`, { params });

// 获取已购车客户关联的车辆信息
export const getCustomerCarInfo = params => axios.get(`${SERVER.CYXDMS_VEHICLE}/sales/chargeback/getCustomerCarInfo`, { params });

// 获取销售顾问信息接口
export const getDealerEmp = params => axios.get(`${SERVER.DMSCLOUD_BASEDATA}/emp/getDealerEmp`, { params });

export const getUserInfoByRolePosition = params => axios.get(`${SERVER.SYSMANAGE}/basedata/roles/getUserInfoByRolePosition`, { params });

export const queryTradedCustomerInfo = params => axios.get(`${SERVER.CYXDMS_VEHICLE}/sales/chargeback/queryTradedCustomerInfo`, { params });
